﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using Songhay.Extensions;

namespace Songhay.DataAccess.Tests
{
    using Extensions;

    /// <summary>
    /// Sql Compact Edition Tests
    /// </summary>
    [TestClass]
    public class SqlCompactEditionTest
    {
        /// <summary>
        /// Gets or sets the test context.
        /// </summary>
        /// <value>The test context.</value>
        public TestContext TestContext { get; set; }

        /// <summary>
        /// Initializes the test.
        /// </summary>
        [TestInitialize]
        public void InitializeTest()
        {
            this.TestContext.RemovePreviousTestResults();
        }

        /// <summary>
        /// Should connect to Chinook SQL Compact Database.
        /// </summary>
        [DeploymentItem(@"Chinook.sdf")]
        [TestCategory("Integration")]
        [TestMethod]
        [TestProperty("connectionString", @"Data Source=""{0}\Chinook.sdf""")]
        [TestProperty("invariantProviderName", "System.Data.SqlServerCe.4.0")]
        public void ShouldConnectToChinook()
        {
            this.TestContext.ShouldOpenConnection();
        }

        /// <summary>
        /// Should connect to Northwind SQL Compact Database.
        /// </summary>
        [DeploymentItem(@"Northwind.sdf")]
        [TestCategory("Integration")]
        [TestMethod]
        [TestProperty("connectionString", @"Data Source=""{0}\Northwind.sdf""")]
        [TestProperty("invariantProviderName", "System.Data.SqlServerCe.4.0")]
        public void ShouldConnectToNorthwind()
        {
            this.TestContext.ShouldOpenConnection();
        }
    }
}
